// Custom Theming for Angular Material
// For more information: https://material.angular.io/guide/theming
@use '@angular/material' as mat;
@use './theme.scss' as theme;
@use './code_theme.scss';

html {
  color-scheme: dark;
  /* Prevent font size inflation */
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  @include mat.theme(
    (
      color: mat.$violet-palette,
      typography: Roboto,
      density: 0,
    )
  );
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin in favour of better control in authored CSS */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

html,
body {
  height: 100%;
}
body.mat-app-background {
  margin: 0;
  font-family: Roboto, 'Helvetica Neue', sans-serif;
  background-color: #17111a;
}

code {
  font-family: 'Space Mono', monospace;
  font-variant-ligatures: none;
}

a {
  text-decoration: none;
  color: #fface6;
  cursor: pointer;
}

// Set up Angular Material
@include mat.core();

:root {
  @include mat.all-component-themes(theme.$dark-theme);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Oxanium', sans-serif;
}

@keyframes entrance {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes exit {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-20px);
  }
}

::view-transition-old(markdown-article) {
  animation: exit 0.25s ease-out 0s 1 normal forwards;
}

::view-transition-new(markdown-article) {
  animation: entrance 0.25s ease-out 0s 1 normal forwards;
}

analog-markdown-route > div {
  view-transition-name: markdown-article;
}

.no-scroll {
  overflow: hidden;
  width: 100%;
}

.video-container {
  width: 100%;
  max-width: 750px;
  justify-content: center;
  margin: 1rem auto;
}

.video-responsive-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;

  > iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}
